﻿using System;
using Orchard.Events;
using Orchard.Localization;
using Orchard.Environment.Extensions;

namespace Rework.CommerceHistory.Rules {
    [OrchardFeature("Rework.CommerceHistory")]
    public class CommerceHistoryEvents : IEventProvider {
        public CommerceHistoryEvents() {
            T = NullLocalizer.Instance;
        }

        public Localizer T { get; set; }

        public void Describe(dynamic describe) {
            Func<dynamic, bool> alwaysTrue = c => true;

            describe.For("CommerceHistory", T("Commerce History"), T("Commerce History"))
                .Element("Created", T("Product Purchase Completed"), T("Product has been purchased and added to commerce history."), alwaysTrue, (Func<dynamic, LocalizedString>)(context => T("When product is added to commerce history.")), null)
                .Element("Updated", T("Product Purchase Updated"), T("Product in Commerce History has been updated."), alwaysTrue, (Func<dynamic, LocalizedString>)(context => T("When product in commerce history is updated.")), null)
                ;
        }
    }
}